import request from "@/utils/axios";

// 添加购物车
export const reqAddToCart = (skuId, skuNum) => {
  return request({
    method: "post",
    url: `/cart/addToCart/${skuId}/${skuNum}`,
  });
};

// 获取购物车列表   /cart/cartList
export const reqGetCartList = () => {
  return request({
    method: "get",
    url: "/cart/cartList",
  });
};


// 切换商品选中状态 /cart/checkCart/{skuID}/{isChecked}

export const reqIsCheckCart = (skuID, isChecked) => {
    return request({
      method: "get",
      url: `/cart/checkCart/${skuID}/${isChecked}`,
    });
};

// 删除购物车商品  /api/cart/deleteCart/{skuId}
  export const reqDeleteCart = (skuId) => {
    return request({
      method: "delete",
      url: `/cart/deleteCart/${skuId}`,
    });
  };

